//package com.jumi.microservice.rocketmq;
//
//import com.aliyun.openservices.ons.api.Action;
//import com.aliyun.openservices.ons.api.ConsumeContext;
//import com.aliyun.openservices.ons.api.Message;
//import com.aliyun.openservices.ons.api.MessageListener;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.stereotype.Component;
//
//@Component
//public class RocketMessageListener implements MessageListener {
//
//    private static Logger log = LoggerFactory.getLogger(RocketMessageListener.class);
//
//    @Override
//    public Action consume(Message message, ConsumeContext context) {
//        log.info("rocker mq message: [{}]", new String(message.getBody()));
//        try {
//            //do something..
//            return Action.CommitMessage;
//        } catch (Exception e) {
//            //消费失败，挂起当前队列
//            return Action.ReconsumeLater;
//        }
//    }
//}
